#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->comboBox->addItem("香辣鸡腿堡");
    ui->comboBox->addItem("芝士堡");
    ui->comboBox->addItem("鸡排堡");

    ui->comboBox_2->addItem("鸡腿");
    ui->comboBox_2->addItem("鸡尖");
    ui->comboBox_2->addItem("鸡翅");

    ui->comboBox_3->addItem("雪碧");
    ui->comboBox_3->addItem("可乐");
    ui->comboBox_3->addItem("芬达");

    ui->spinBox->setRange(1,5);
    ui->spinBox->setValue(1);

    ui->spinBox_2->setRange(1,5);
    ui->spinBox_2->setValue(1);

    ui->spinBox_3->setRange(1,5);
    ui->spinBox_3->setValue(1);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_clicked()
{
    QString str = "点单结果：";
    str += ui->comboBox->currentText() + ": " + QString::number(ui->spinBox->value()) + "、";
    str += ui->comboBox_2->currentText() + ": " + QString::number(ui->spinBox_2->value()) + "、";
    str += ui->comboBox_3->currentText() + ": " + QString::number(ui->spinBox_3->value());
    ui->label_4->setText(str);
}

